package com.chenfei.datasource.controller;

import com.chenfei.datasource.service.DataSourceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chenfei
 * @description
 * @since 2018/4/11
 */
@RestController
@Slf4j
@RequestMapping(value = "/student")
public class DataSourceController {

    @Autowired
    DataSourceService dataSourceService;

    @PostMapping(value = "/add")
    public Object add(){
        return dataSourceService.addStudent();
    }

    @GetMapping(value = "/find")
    public Object find(){
        return dataSourceService.findStudent(3);
    }
}
